<?php

namespace App\Mp\Controllers;

use Illuminate\Http\Request;
use App\Mp\Controllers\Mp;
use Mp\Service\Common\NavManager;
use Smart\Models\SysFunc;
use Mp\Facades\Grid;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Illuminate\Support\Facades\Auth;
use Smart\Models\SysUser;
use  Mp\Facades\Tree;
use Mp\Facades\Form;
use Mp\Facades\Widget;
use Facades\Mp\Service\Tab\Tab;



class IndexController extends Mp
{ 
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct(Request $request)
    {   
        parent::__construct($request);
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Auth $user)
    {   $this->_init('首页');
        $this->_makeNav(['title'=> '仪表盘']);
       $form =  Form::form(function($form){
            $form->widget( Widget::button()->label('按钮')->size('lg')->status('disable')->icon('navigation-menu') );
        });

       $tab = Tab::page(function($page){
       
        $page->title('标题1');
        $page->content('我是页面的内容吖');

       })->page(function ($page){

        $page->title('标题2');
        $page->content('这是页面的内容');
       })->page(function($page){
        $page->title('刺激战场');
        $page->content('老可爱哇哦');
       });
       $this->_addData('tab',$tab);
       $this->_addData('form',$form);

        return $this->_displayWithLayout('Mp::index.index');
    }

    
}
